<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2022/8/5
  Time: 11:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%String path = request.getContextPath()+"/";%>

<html>
<head>
    <base href="<%=path%>">
    <title>编辑用户信息</title>
    <link rel="stylesheet" href="js/bootstrap/css/bootstrap.css">
    <script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="js/bootstrap/js/bootstrap.js"></script>
</head>
<body style="overflow-x: hidden">
<form class="form-horizontal" id="form1">
    <input type="hidden" name="id" value="${user.id}" id="userId">
    <div class="form-group">
        <label  class="col-sm-2 control-label">登录名</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" name="userName" value="${user.userName}"  placeholder="登录名" id="userName">
        </div>
    </div>
    <div class="form-group">
        <label  class="col-sm-2 control-label">密码</label>
        <div class="col-sm-10">
            <input type="password" class="form-control" name="pwd" value="${user.pwd}"   placeholder="Password">
        </div>
    </div>
    <div class="form-group">
        <label  class="col-sm-2 control-label">真实姓名</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" name="realName" value="${user.realName}" placeholder="Password">
        </div>
    </div>
    <div class="form-group">
        <label  class="col-sm-2 control-label">所属部门</label>
        <div class="col-sm-10">
            <select class="form-control">
                <c:forEach items="${depts}" var="dept">
                    <option value="${dept.id}" <c:if test="${user.deptId==dept.id}">selected</c:if> >部门1</option>
                </c:forEach>
            </select>
        </div>
    </div>

    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <button type="button" class="btn btn-success" onclick="save();"><span class="glyphicon glyphicon-floppy-disk"></span> 保存</button>
            <button type="reset" class="btn btn-danger"><span class="glyphicon glyphicon-repeat"></span> 重置</button>
        </div>
    </div>
</form>
</body>
<script type="text/javascript" src="js/layer/layer.js"></script>
<script type="text/javascript" src="js/bootstrap/rbac.js"></script>
<script>

    function save(){
        $.operator.save('user/save',$("#form1").serialize());
    }
$(function(){
    $.ajax()
})

</script>
</html>
